package org.xu.utils;


import org.apache.tomcat.util.codec.binary.Base64;

public class Base64Util {
    // 加密
    public static String encode(String str) {
        String encodeBase64String = Base64.encodeBase64String(str.getBytes());
        return encodeBase64String;
    }

    // 解密
    public static String decode(String s) {
        byte[] decodeBase64 = Base64.decodeBase64(s);
        s=new String(decodeBase64);
        return s;
    }

}